<?php
$username = array(
    'name'	=> 'username',
    'id'	=> 'username',
    'size'	=> 30,
    'value' =>  set_value('username'),
    'class' => 'text'
);

$password = array(
    'name'	=> 'password',
    'id'	=> 'password',
    'size'	=> 30,
    'value' => set_value('password'),
    'class' => 'text'
);

$confirm_password = array(
    'name'	=> 'confirm_password',
    'id'	=> 'confirm_password',
    'size'	=> 30,
    'value' => set_value('confirm_password'),
    'class' => 'text'
);

$email = array(
    'name'	=> 'email',
    'id'	=> 'email',
    'maxlength'	=> 80,
    'size'	=> 30,
    'value'	=> set_value('email'),
    'class' => 'text'
);

$role = array(
    'id' => 'role',
    'name' => 'role'
);

$submit = array(
    'name'	=> 'submit',
    'id'	=> 'submit',
    'value'	=> 'Submit',
    'class' => 'submit'
);

$reset = array(
    'name'	=> 'reset',
    'id'	=> 'reset',
    'value'	=> 'Reset',
    'class' => 'submit'
);

?>
<head>
    <?php $this->load->view('load_view'); ?>
</head>
<div class="col-wrap handin-wrap">
    <!--start col-->
    <div class="col handin">
        <div class="wrap-title">
            <p class="page-title">
                用户管理
            </p>
        </div>

        <p class="desc">
    	介绍：添加用户，或班级，对用户进行管理
        </p>
        <div class="itemtitle">
            <h3>操作类型</h3>
            <?php $this->load->view('admin/useroptions'); ?>
            <div class="clear"></div>
        </div>
        <div class="arrange manageform">
            <?php echo form_open($this->uri->uri_string())?>
            <p>
                <?php echo form_label('Username', $username['id']);?>
                <?php echo form_input($username)?>
                <?php echo form_error($username['name']); ?>
            </p>
            <p>
                <?php echo form_label('Password', $password['id']);?>
                <?php echo form_password($password)?>
                <?php echo form_error($password['name']); ?>
            </p>
            <p>
                <?php echo form_label('Confirm Password', $confirm_password['id']);?>
                <?php echo form_password($confirm_password);?>
                <?php echo form_error($confirm_password['name']); ?>
            </p>
            <p>
                <?php echo form_label('Email Address', $email['id']);?>
                <?php echo form_input($email);?>
                <?php echo form_error($email['name']); ?>

            </p>
            <p>
                <?php echo form_label('用户组', $role['id']);?>
                <select name="role">
                    <option value="3" <?php echo set_select('role', '3', TRUE); ?> >老师</option>
                    <option value="4" <?php echo set_select('role', '4'); ?> >内审员</option>
                </select>
            </p>
            <?php echo form_submit($submit); ?>
            <?php echo form_reset($reset); ?>
            <?php echo form_close()?>
        </div>

    </div>
    <!--end col-->
    <?php
    if($adduser_messege!='') {
        ?>
    <div id="error"><?php echo $adduser_messege; ?></div>
    <script>
        $('#error').css('opacity','0').animate({'opacity':'1'},function(){
            setTimeout(function(){
                $('#error').animate({'opacity':'0'})
            },2300)
        })
    </script>
    <?php
    }else {}
    ?>
</div>
<!--end col-wrap-->
<script>
    $('ul.selectNav li#adduser').addClass('current');
    $(window.parent.document).find("ul.nav li a").removeClass("then");
    $(window.parent.document).find("a#usermanage").attr("class","then");
</script>
